/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package IFSv2.Util;

import java.awt.Color;
import java.awt.Component;
import java.awt.Font;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JList;
import javax.swing.ListCellRenderer;

/**
 *
 * @author Joel
 */
public class ListRenderer extends javax.swing.JLabel implements ListCellRenderer{
    
    @Override
    public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {

         setText(value.toString());
         setOpaque(true);
         setBackground(Color.WHITE);
         
         setFont(new Font("Tahoma", Font.PLAIN, 12));

         if (isSelected) {
             setFont(new Font("Tahoma", Font.BOLD, 12));
             setBackground(new Color(214,214,214));
         } else {
             setFont(new Font("Tahoma", Font.PLAIN, 12));
             setForeground(Color.BLACK);
             
         }
       
         return this;
    }
}
